Hardware contiguous memory region tracking

ABSTRACT

Embodiments of the invention relate to performing a scan of a memory region associated with a virtual machine. The scan is performed by a hardware mechanism in response to a call. A data structure that includes information about substrings identified during the scan and a number of replications for each substring is constructed by the hardware mechanism. The data structure is stored by the hardware mechanism at a location determined by the call.

BACKGROUND

The present invention relates to management of virtual machines (VMs),and more specifically, to a method for balancing virtual machine loadsbetween hardware platforms.

Providers of cloud computing have the competing tasks of providingdesired performance for consumers or end users while also efficientlyallocating the resources used to provide services to consumers. Theresources may be dynamically allocated by the provider to help achievethese goals. Accordingly, a hardware platform may host a plurality ofvirtual machines, wherein each virtual machine corresponds to aconsumer. Efficient use of the hardware platform resources dictates thatthe provider place as many virtual machines on the platform as possiblewithout compromising the consumer's use of the virtual machine andexperience. It may be desirable to move or migrate a virtual machinefrom one hardware platform to another to ensure that the customer is notadversely affected by changes in resource availability for the virtualmachines.

SUMMARY

An embodiment is a method for performing a scan of a memory regionassociated with a virtual machine. The scan is performed by a hardwaremechanism in response to a call. A data structure that includesinformation about substrings identified during the scan and a number ofreplications for each substring is constructed by the hardwaremechanism. The data structure is stored by the hardware mechanism at alocation determined by the call.

Another embodiment is an apparatus that includes at least one processorand a storage device. The storage device has instructions stored thereonthat, when executed by the at least one processor, cause the apparatusto perform a scan of a memory region associated with a virtual machine.The scan is performed by a hardware mechanism in response to a call. Adata structure that includes information about substrings identifiedduring the scan and a number of replications for each substring isconstructed by the hardware mechanism. The data structure is stored bythe hardware mechanism at a location determined by the call.

A further embodiment is a computer program product that includes acomputer readable storage medium having computer readable program codeembodied therewith. The computer readable program code includes computerreadable program code configured for performing a scan of a memoryregion associated with a virtual machine. The scan is performed by ahardware mechanism in response to a call. A data structure that includesinformation about substrings identified during the scan and a number ofreplications for each substring is constructed by the hardwaremechanism. The data structure is stored by the hardware mechanism at alocation determined by the call.

Additional features and advantages are realized through the techniquesof the present invention. Other embodiments and aspects of the inventionare described in detail herein and are considered a part of the claimedinvention. For a better understanding of the invention with theadvantages and the features, refer to the description and to thedrawings.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The subject matter which is regarded as the invention is particularlypointed out and distinctly claimed in the claims at the conclusion ofthe specification. The foregoing and other features, and advantages ofthe invention are apparent from the following detailed description takenin conjunction with the accompanying drawings in which:

FIG. 1 depicts a cloud computing node according to an embodiment of thepresent invention;

FIG. 2 depicts a cloud computing environment according to an embodimentof the present invention;

FIG. 3 depicts abstraction model layers according to an embodiment ofthe present invention;

FIG. 4 illustrates exemplary memory locations in accordance with anembodiment; and

FIG. 5 illustrates a flow chart of an exemplary method in accordancewith an embodiment.

DETAILED DESCRIPTION

Embodiments described herein are directed to performing a scan of aregion of memory associated with a virtual machine (VM). In someembodiments, based on the scan of the memory region, a data structure isconstructed that identifies indices of pages that are identical. In someembodiments, if no pages are the same, then the data structure indicatesthat with, for example, a value of ‘null’.

It is understood in advance that although this disclosure includes adetailed description on cloud computing, implementation of the teachingsrecited herein are not limited to a cloud computing environment. Rather,embodiments of the present invention are capable of being implemented inconjunction with any other type of computing environment now known orlater developed (e.g., any client-server model or distributed model).

Cloud computing is a model of service delivery for enabling convenient,on-demand network access to a shared pool of configurable computingresources (e.g. networks, network bandwidth, servers, processing,memory, storage, applications, virtual machines, and services) that canbe rapidly provisioned and released with minimal management effort orinteraction with a provider of the service. This cloud model may includeat least five characteristics, at least three service models, and atleast four deployment models.

Characteristics are as follows:

On-Demand Self-Service: a cloud consumer can unilaterally provisioncomputing capabilities, such as server time and network storage, asneeded automatically without requiring human interaction with theservice's provider.

Broad Network Access: capabilities are available over a network andaccessed through standard mechanisms that promote use by heterogeneousthin or thick client platforms (e.g., mobile phones, laptops, and PDAs).

Resource Pooling: the provider's computing resources are pooled to servemultiple consumers using a multi-tenant model, with different physicaland virtual resources dynamically assigned and reassigned according todemand. There is a sense of location independence in that the consumergenerally has no control or knowledge over the exact location of theprovided resources but may be able to specify location at a higher levelof abstraction (e.g., country, state, or datacenter).

Rapid Elasticity: capabilities can be rapidly and elasticallyprovisioned, in some cases automatically, to quickly scale out andrapidly released to quickly scale in. To the consumer, the capabilitiesavailable for provisioning often appear to be unlimited and can bepurchased in any quantity at any time.

Measured Service: cloud systems automatically control and optimizeresource use by leveraging a metering capability at some level ofabstraction appropriate to the type of service (e.g., storage,processing, bandwidth, and active user accounts). Resource usage can bemonitored, controlled, and reported providing transparency for both theprovider and consumer of the utilized service.

Service Models are as follows:

Software as a Service (SaaS): the capability provided to the consumer isto use the provider's applications running on a cloud infrastructure.The applications are accessible from various client devices through athin client interface such as a web browser (e.g., web-based e-mail).The consumer does not manage or control the underlying cloudinfrastructure including network, servers, operating systems, storage,or even individual application capabilities, with the possible exceptionof limited user-specific application configuration settings.

Platform as a Service (PaaS): the capability provided to the consumer isto deploy onto the cloud infrastructure consumer-created or acquiredapplications created using programming languages and tools supported bythe provider. The consumer does not manage or control the underlyingcloud infrastructure including networks, servers, operating systems, orstorage, but has control over the deployed applications and possiblyapplication hosting environment configurations.

Infrastructure as a Service (IaaS): the capability provided to theconsumer is to provision processing, storage, networks, and otherfundamental computing resources where the consumer is able to deploy andrun arbitrary software, which can include operating systems andapplications. The consumer does not manage or control the underlyingcloud infrastructure but has control over operating systems, storage,deployed applications, and possibly limited control of select networkingcomponents (e.g., host firewalls).

Deployment Models are as follows:

Private Cloud: the cloud infrastructure is operated solely for anorganization. It may be managed by the organization or a third party andmay exist on-premises or off-premises.

Community Cloud: the cloud infrastructure is shared by severalorganizations and supports a specific community that has shared concerns(e.g., mission, security requirements, policy, and complianceconsiderations). It may be managed by the organizations or a third partyand may exist on-premises or off-premises.

Public Cloud: the cloud infrastructure is made available to the generalpublic or a large industry group and is owned by an organization sellingcloud services.

Hybrid Cloud: the cloud infrastructure is a composition of two or moreclouds (private, community, or public) that remain unique entities butare bound together by standardized or proprietary technology thatenables data and application portability (e.g., cloud bursting forload-balancing between clouds).

A cloud computing environment is service oriented with a focus onstatelessness, low coupling, modularity, and semantic interoperability.At the heart of cloud computing is an infrastructure comprising anetwork of interconnected nodes.

Referring now to FIG. 1, a schematic of an example of a cloud computingnode is shown. Cloud computing node 10 is only one example of a suitablecloud computing node and is not intended to suggest any limitation as tothe scope of use or functionality of embodiments of the inventiondescribed herein. Regardless, cloud computing node 10 is capable ofbeing implemented and/or performing any of the functionality set forthhereinabove.

In cloud computing node 10 there is a computer system/server 12, whichis operational with numerous other general purpose or special purposecomputing system environments or configurations. Examples of well-knowncomputing systems, environments, and/or configurations that may besuitable for use with computer system/server 12 include, but are notlimited to, personal computer systems, server computer systems, thinclients, thick clients, hand-held or laptop devices, multiprocessorsystems, microprocessor-based systems, set top boxes, programmableconsumer electronics, network PCs, minicomputer systems, mainframecomputer systems, and distributed cloud computing environments thatinclude any of the above systems or devices, and the like.

Computer system/server 12 may be described in the general context ofcomputer system-executable instructions, such as program modules, beingexecuted by a computer system. Generally, program modules may includeroutines, programs, objects, components, logic, data structures, and soon that perform particular tasks or implement particular abstract datatypes. Computer system/server 12 may be practiced in distributed cloudcomputing environments where tasks are performed by remote processingdevices that are linked through a communications network. In adistributed cloud computing environment, program modules may be locatedin both local and remote computer system storage media including memorystorage devices.

As shown in FIG. 1, computer system/server 12 in cloud computing node 10is shown in the form of a general-purpose computing device. Thecomponents of computer system/server 12 may include, but are not limitedto, one or more processors or processing units 16, a system memory 28,and a bus 18 that couples various system components including systemmemory 28 to processor 16.

Bus 18 represents one or more of any of several types of bus structures,including a memory bus or memory controller, a peripheral bus, anaccelerated graphics port, and a processor or local bus using any of avariety of bus architectures. By way of example, and not limitation,such architectures include Industry Standard Architecture (ISA) bus,Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, VideoElectronics Standards Association (VESA) local bus, and PeripheralComponent Interconnects (PCI) bus.

Computer system/server 12 typically includes a variety of computersystem readable media. Such media may be any available media that isaccessible by computer system/server 12, and it includes both volatileand non-volatile media, removable and non-removable media.

System memory 28 can include computer system readable media in the formof volatile memory, such as random access memory (RAM) 30 and/or cachememory 32. Computer system/server 12 may further include otherremovable/non-removable, volatile/non-volatile computer system storagemedia. By way of example only, storage system 34 can be provided forreading from and writing to a non-removable, non-volatile magnetic media(not shown and typically called a “hard drive”). Although not shown, amagnetic disk drive for reading from and writing to a removable,non-volatile magnetic disk (e.g., a “floppy disk”), and an optical diskdrive for reading from or writing to a removable, non-volatile opticaldisk such as a CD-ROM, DVD-ROM or other optical media can be provided.In such instances, each can be connected to bus 18 by one or more datamedia interfaces. As will be further depicted and described below,memory 28 may include at least one program product having a set (e.g.,at least one) of program modules that are configured to carry out thefunctions of embodiments of the invention.

Program/utility 40, having a set (at least one) of program modules 42,may be stored in memory 28 by way of example, and not limitation, aswell as an operating system, one or more application programs, otherprogram modules, and program data. Each of the operating system, one ormore application programs, other program modules, and program data orsome combination thereof, may include an implementation of a networkingenvironment. Program modules 42 generally carry out the functions and/ormethodologies of embodiments of the invention as described herein.

Computer system/server 12 may also communicate with one or more externaldevices 14 such as a keyboard, a pointing device, a display 24, etc.;one or more devices that enable a user to interact with computersystem/server 12; and/or any devices (e.g., network card, modem, etc.)that enable computer system/server 12 to communicate with one or moreother computing devices. Such communication can occur via I/O interfaces22. Still yet, computer system/server 12 can communicate with one ormore networks such as a local area network (LAN), a general wide areanetwork (WAN), and/or a public network (e.g., the Internet) via networkadapter 20. As depicted, network adapter 20 communicates with the othercomponents of computer system/server 12 via bus 18. It should beunderstood that although not shown, other hardware and/or softwarecomponents could be used in conjunction with computer system/server 12.Examples, include, but are not limited to: microcode, device drivers,redundant processing units, external disk drive arrays, RAID systems,tape drives, and data archival storage systems, etc.

Referring now to FIG. 2, illustrative cloud computing environment 50 isdepicted. As shown, cloud computing environment 50 comprises one or morecloud computing nodes 10 with which local computing devices used bycloud consumers, such as, for example, personal digital assistant (PDA)or cellular telephone 54A, desktop computer 54B, laptop computer 54C,and/or automobile computer system 54N may communicate. Nodes 10 maycommunicate with one another. They may be grouped (not shown) physicallyor virtually, in one or more networks, such as Private, Community,Public, or Hybrid clouds as described hereinabove, or a combinationthereof. This allows cloud computing environment 50 to offerinfrastructure, platforms and/or software as services for which a cloudconsumer does not need to maintain resources on a local computingdevice. It is understood that the types of computing devices 54A-N shownin FIG. 2 are intended to be illustrative only and that computing nodes10 and cloud computing environment 50 can communicate with any type ofcomputerized device over any type of network and/or network addressableconnection (e.g., using a web browser).

Referring now to FIG. 3, a set of functional abstraction layers providedby cloud computing environment 50 (FIG. 2) is shown. It should beunderstood in advance that the components, layers, and functions shownin FIG. 3 are intended to be illustrative only and embodiments of theinvention are not limited thereto. As depicted, the following layers andcorresponding functions are provided:

Hardware and software layer 60 includes hardware and softwarecomponents. Examples of hardware components include mainframes, in oneexample IBM® zSeries® systems; RISC (Reduced Instruction Set Computer)architecture based servers, in one example IBM pSeries® systems; IBMxSeries® systems; IBM BladeCenter® systems; storage devices; networksand networking components. Examples of software components includenetwork application server software, in one example IBM WebSphere®application server software; and database software, in one example IBMDB2® database software. (IBM, zSeries, pSeries, xSeries, BladeCenter,WebSphere, and DB2 are trademarks of International Business MachinesCorporation registered in many jurisdictions worldwide)

Virtualization layer 62 provides an abstraction layer from which thefollowing examples of virtual entities may be provided: virtual servers;virtual storage; virtual networks, including virtual private networks;virtual applications and operating systems; and virtual clients.

In one example, management layer 64 may provide the functions describedbelow. Resource provisioning provides dynamic procurement of computingresources and other resources that are utilized to perform tasks withinthe cloud computing environment. Metering and Pricing provide costtracking as resources are utilized within the cloud computingenvironment, and billing or invoicing for consumption of theseresources. In one example, these resources may comprise applicationsoftware licenses. Security (not shown) provides identity verificationfor cloud consumers and tasks, as well as protection for data and otherresources. User portal provides access to the cloud computingenvironment for consumers and system administrators. Service levelmanagement provides cloud computing resource allocation and managementsuch that required service levels are met. Service Level Agreement (SLA)planning and fulfillment provide pre-arrangement for, and procurementof, cloud computing resources for which a future requirement isanticipated in accordance with an SLA.

Workloads layer 66 provides examples of functionality for which thecloud computing environment may be utilized. Examples of workloads andfunctions which may be provided from this layer include: mapping andnavigation; software development and lifecycle management; virtualclassroom education delivery; data analytics processing; transactionprocessing; and a mobile desktop for mobile devices (e.g., 54A, 54C, and54N, as well as mobile nodes 10 in cloud computing environment 50)accessing the cloud computing services.

In one embodiment, one or both of the hardware and software layer 60 andthe virtualization layer 62 may include edge components, such as a webserver front end and image cache, as well as an image library store,e.g., in a high-performance RAID storage area network (SAN). In anexemplary embodiment, an application, such as a virtual machinemonitoring application 70 in the virtualization layer 62, may implementa process or method for scanning one or more memory regions associatedwith one or more virtual machines; however, it will be understood thatthe application 70 may be implemented in any layer.

In some instances, it is desirable to move data from a first location toa second location. For example, as part of a migration of a VM, data maybe moved from, e.g., a first location (e.g., a first device or machine)to a second location (e.g., a second device or machine. A movement ofdata may be performed at runtime, potentially with or without aninterruption of service.

In some embodiments, after the data is moved from the first location tothe second location, the data at the first location is deleted or thefirst location is flagged as being free or clear for writing. Suchtreatment of the first location may be used to free memory or storage atthe first location.

In some embodiments, after the data is moved from the first location tothe second location the data at the first location is retained. Suchtreatment may be used to facilitate generating a copy of the data forpurposes of, e.g., enhanced reliability or quality of service (QoS).

Turning now to FIG. 4, a memory 402 is shown. In some embodiments, thememory 402 may correspond to the memory 28 of FIG. 1 (or a portionthereof). For purposes of illustrative simplicity, the memory 402 isshown as included sixteen addressable locations 404, numbered 0 through15 (404 a-404 p). In some embodiments, the memory 402 includes more orless than sixteen locations 404. The locations 0-15 (404 a-404 p) may becontiguous or non-contiguous. In some embodiments, one or more of thelocations 404 may correspond to a page.

In some embodiments, a scan of the memory 402 occurs. In someembodiments, the scan is performed by one or more devices or entities,such as the processing unit 16 of FIG. 1.

In some embodiments, the scan may be performed using a processor orprocessing unit that is separate or distinct from the processing unit 16of FIG. 1. For example, as shown in FIG. 4, a processor 420 may performthe scan. The processor 420 may correspond to an offload processor, ageneral-purpose processor or GPU, etc.

In some embodiments the scan may be originated in a hypervisor operatingsystem with full hardware addressing, or a hypervisor operating systemusing virtual hardware addressing, or by a userspace application usingvirtual addressing.

In some embodiments, the scan is used to identify substrings of datathat repeat themselves in a region of the memory 402 that is ofinterest. The region of the memory 402 that is of interest may beidentified using a beginning address and an ending address. In theillustrative example of FIG. 4, the beginning address 406 a correspondsto address 2 404 c and the ending address 406 b corresponds to address 9404 j. The results of the scan may be written to a data structure, andthe data structure may be stored to an identified memory address. In theillustrative example of FIG. 4, the data structure may be written to astorage or memory address 406 c corresponding to an address or location‘Q’ 404 q.

In some embodiments, to facilitate the above operation, a scan function,process, routine, procedure, etc., may be implemented of the form:

scn beginaddr endaddr storeaddr,

where scn is a scan call (e.g., a scan assembly call), beginaddr is theaddress at which the scan begins (e.g., 406 a in FIG. 4), endaddr is theaddress at which the scan ends (e.g., 406 b in FIG. 4), and storeaddr isthe address where the resulting data structure is stored in memory(e.g., 406 c in FIG. 4).

The above scan call may be generalized to accommodate the use ofregisters as an alternative to, or in addition to, the use of addresses(e.g., memory addresses). For example, “beginaddr” can optionally bereplaced with “beginreg” to identify a register that contains thestarting address to start a scan with. Similarly, “endaddr” canoptionally be replaced with “endreg” to identify a register thatcontains the ending address to end a scan with. Similarly, “storeaddr”can optionally be replaced with “storereg” to identify a register whoselocation will be filled with the starting address of a data structurethat includes results from having performed the scan. Thus, a scan maybe performed using any combination of addresses and registers for thebeginning, ending, and storage location parameters or arguments.

In some embodiments, a flag or register may be used to indicate that allof memory should be scanned. For example, depending on the context, allhost memory may be scanned, such as in situations where a hypervisor isperforming the scan, or the root user of a virtual machine, or a virtualmachine operating system scanning all memory in that virtual machine. Insome embodiments, a separate assembler may be called, for example, scanaor alternatively using particular values for the arguments.

In some embodiments, the scn call includes one or more additionalarguments. For example, the scn call may take the form:

scn beginreg endaddr storeaddr minlen,

where the “minlen” argument represents a minimum length of a memorychunk whose replications are to be recorded. Specification of the“minlen” argument may be used to filter out short substrings that wouldnot be of interest. Minlen may be expressed in some known units such asbytes, nibbles, words, bits, etc. For example, if the minlen isspecified in bytes, setting minlen to one (1) may be used to filter outresults of length less than one (1) byte from the resulting datastructure.

The value for the argument “minlen” may be specified based on aparticular application environment or context. In some embodiments, ascan is performed for various sized strings, sub strings, or chunks ofmemory. For example, a dynamic scan may be performed for various sizedstrings by changing or adjusting the “minlen” argument over multiple scncalls. In some embodiments, a particular value of minlen may bespecified as an address or register that indicates the hardware is toperform dynamic scans without repeated calls to the scan assemblerroutine by the application.

Once beginning and ending locations are specified for a scan call, andthe scan is performed, all substrings (or all substrings of at least“minlen” if such an argument is used) may be recorded or written to astorage location (e.g., memory address ‘Q’ 404 q). In some embodiments,an identification or count of the number of instances or occurrences foreach of the substrings is also recorded to the storage location inaccordance with a known storage format.

Aspects of the disclosure may be applied in connection with metadata.For example, a register may have a value that is set to the length ofthe longest replicated string, an associated register may have a valuethat is set to the starting address of the replicated string, and asecond associated register may contain the number of times the stringhas been replicated.

Turning now to FIG. 5, a flow chart of an exemplary method 500 is shown.The method 500 may be executed in connection with one or more systems,components, or devices, such as those described herein. In someembodiments, the method 500 may be implemented by the application 70 ofFIG. 3. The method 500 may be executed to collect metadata regardinginformation or data (e.g., substrings) stored in one or more memorydevices.

In block 502, the method 500 may start. From block 502, flow may proceedto block 504.

In block 504, an entity (e.g., a system, an apparatus or device, etc.)may listen for a call, such as an assembler call. The call maycorrespond to an invocation of a scan routine, procedure, function, etc.From block 504, flow may proceed to block 506.

In block 506, a determination may be made regarding one or moreaddresses or registers to begin and end a scan. The addresses and/orregisters may be specified as part of the call of block 504. From block506, flow may proceed to block 508.

In block 508, a location (e.g., an address) may be determined oridentified for purposes of storing a data structure that includesresults from the call or running a scan. The location may be specifiedas part of the call of block 504. From block 508, flow may proceed toblock 510.

In block 510, a minimum length of a substring to track may be determinedor identified. The minimum length may be specified as part of the callof block 504. From block 510, flow may proceed to block 512.

In block 512, a scan of memory may be performed based on the addressesand/or registers associated with block 506. Some or all substrings maybe tracked. For example, substrings that are greater than or equal to aminimum length (block 510) may be tracked. A number of replications oroccurrences of each substring that is tracked may also be tracked orrecorded. From block 512, flow may proceed to block 514.

In block 514, a data structure may be constructed. The constructed datastructure may include information on the substrings that were trackedand the number of replications or occurrences (block 512). This datastructure may be located in a region of system memory, placed in vectorpairs/sets of registers, or placed in some special purpose storage(volatile or nonvolatile). From block 514, flow may proceed to block516.

In block 516, the information or the data structure constructed as partof block 514 may be stored at the location determined/identified inblock 508. From block 516, flow may proceed to block 504. The flow fromblock 516 to block 504 may establish a loop, such that once a first callor scan is performed or processed, subsequent calls or scans may beperformed and processed.

The blocks or operations of the method 500 are illustrative. In someembodiments, one or more of the blocks (or a portion thereof) isoptional. In some embodiments, one or more blocks execute in an order orsequence different from what is shown in FIG. 5 (e.g., blocks 506, 508,and 510 could execute in any order). In some embodiments, one or moreadditional blocks not shown are included.

In some embodiments a machine may determine what data is available atthe machine by performing a scan. The scan may be performed by ahypervisor or virtual machine manager (VMM). The scan may be performedon memory, e.g., all or a portion of the memory, or virtual memoryreferenced by one or more VMs. The VMs may be located on, or hosted by,the machine. The machine may transmit or broadcast information relatingto the data that is available. The data may pertain to strings,substrings, pages of memory, metadata, etc.

In some embodiments, a hardware entity may be configured to quickly scana contiguous or non-contiguous memory region that includes one or morecontiguous fixed size regions of memory. A data structure (e.g., a map,table, or chained linked list (optionally sorted)) may be constructed ofpage indices which are identical or may indicate or include a ‘null’ ifno pages are the same. For example, a table may be configured such thatif a contiguous known fixed length memory region's index is entered, alinked list of all other memory region indices, which contain identicalcontents at that address, may be provided (or a ‘null’ may be providedif no pages are the same).

In some embodiments, offsets or lengths may be used within a page orcontiguous page regions to facilitate partial same-page replicationdetection. In some embodiments, a location of an optimal size region formemory sharing may be determined by iterating over all pages multipletimes (e.g., multiple times per second), adjusting an index into thepage by a single byte, and adjusting the length by a single byte, untilall indices within a page and all region sizes within a page arecomputed. In some embodiments, scans may be performed in parallel toimprove or enhance efficiency. The average size (e.g., mean, median,mode, and standard deviation, or any combination of the above) ofchained items in a data structure (e.g., a map, table, or linked list)may be stored to obtain a sense for the distribution of same-pagevalues. In some embodiments, the results of such a computation may beplaced in a register, facilitating fast access to the results. In someembodiments, an operating system or other software may access theresults.

In some embodiments, direct data or (sub)string comparisons may beperformed to determine or identify instances or occurrences of data.Such information may be used to migrate a VM from a first machine to oneor more additional machines. Hardware based scans may be performed toincrease the speed at which a machine or VM's memory environment ischaracterized. Fast characterization may be needed in environmentsassociated with large amounts of data, such as data centers, serverapplications, etc.

In some embodiments, VMs may point to or reference a shared memory suchthat data transfer or data replication operations may be reduced orminimized. Furthermore, resources (e.g., storage resources) may bepreserved such that the number of VMs hosted on a single machine may beincreased or maximized.

In some embodiments, one or more data structures may be implementedusing rabin fingerprinting. Rabin fingerprinting may be used in someembodiments, potentially in lieu of using a hash table or hash tablebased protocol or in lieu of a perfect bit matching to enable speedups.

In some embodiments, entries may be invalidated when a guest is writingto referenced memory regions. Computed values may be correct for only apoint in time, but may be invalidated seconds later under heavy dynamicmemory workloads.

Technical effects and benefits include a storage of indices associatedwith shared memory regions. By keeping a data structure of indices, asopposed to storing or sharing entire memory pages, overhead may bereduced and performance may be increased or enhanced. The indices ormetadata may be used to migrate between machines or facilitategenerating copies of data between machines.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a”, “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”and/or “comprising,” when used in this specification, specify thepresence of stated features, integers, steps, operations, elements,and/or components, but do not preclude the presence or addition of oneor more other features, integers, steps, operations, elements,components, and/or groups thereof.

The corresponding structures, materials, acts, and equivalents of allmeans or step plus function elements in the claims below are intended toinclude any structure, material, or act for performing the function incombination with other claimed elements as specifically claimed. Thedescription of the present invention has been presented for purposes ofillustration and description, but is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the artwithout departing from the scope and spirit of the invention. Theembodiments were chosen and described in order to best explain theprinciples of the invention and the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

Further, as will be appreciated by one skilled in the art, aspects ofthe present invention may be embodied as a system, method, or computerprogram product. Accordingly, aspects of the present invention may takethe form of an entirely hardware embodiment, an entirely softwareembodiment (including firmware, resident software, micro-code, etc.) oran embodiment combining software and hardware aspects that may allgenerally be referred to herein as a “circuit,” “module” or “system.”Furthermore, aspects of the present invention may take the form of acomputer program product embodied in one or more computer readablemedium(s) having computer readable program code embodied thereon.

Any combination of one or more computer readable medium(s) may beutilized. The computer readable medium may be a computer readable signalmedium or a computer readable storage medium. A computer readablestorage medium may be, for example, but not limited to, an electronic,magnetic, optical, electromagnetic, infrared, or semiconductor system,apparatus, or device, or any suitable combination of the foregoing. Morespecific examples (a non-exhaustive list) of the computer readablestorage medium would include the following: an electrical connectionhaving one or more wires, a portable computer diskette, a hard disk, arandom access memory (RAM), a read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), an optical fiber,a portable compact disc read-only memory (CD-ROM), an optical storagedevice, a magnetic storage device, or any suitable combination of theforegoing. In the context of this document, a computer readable storagemedium may be any tangible medium that can contain, or store a programfor use by or in connection with an instruction execution system,apparatus, or device.

A computer readable signal medium may include a propagated data signalwith computer readable program code embodied therein, for example, inbaseband or as part of a carrier wave. Such a propagated signal may takeany of a variety of forms, including, but not limited to,electro-magnetic, optical, or any suitable combination thereof. Acomputer readable signal medium may be any computer readable medium thatis not a computer readable storage medium and that can communicate,propagate, or transport a program for use by or in connection with aninstruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmittedusing any appropriate medium, including but not limited to wireless,wireline, optical fiber cable, radio frequency (RF), etc., or anysuitable combination of the foregoing.

Computer program code for carrying out operations for aspects of thepresent invention may be written in any combination of one or moreprogramming languages, including an object oriented programming languagesuch as Java, Smalltalk, C++ or the like and conventional proceduralprogramming languages, such as the “C” programming language or similarprogramming languages. The program code may execute entirely on theuser's computer, partly on the user's computer, as a stand-alonesoftware package, partly on the user's computer and partly on a remotecomputer or entirely on the remote computer or server. In the latterscenario, the remote computer may be connected to the user's computerthrough any type of network, including a local area network (LAN) or awide area network (WAN), or the connection may be made to an externalcomputer (for example, through the Internet using an Internet ServiceProvider). In some embodiments, assembler or millicode/microcode on anembedded or special purpose processor may be used to implement one ormore aspects of this disclosure.

Aspects of the present invention are described above with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems) and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer program instructions. These computer program instructions maybe provided to a processor of a general purpose computer, specialpurpose computer, or other programmable data processing apparatus toproduce a machine, such that the instructions, which execute via theprocessor of the computer or other programmable data processingapparatus, create means for implementing the functions/acts specified inthe flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computerreadable medium that can direct a computer, other programmable dataprocessing apparatus, or other devices to function in a particularmanner, such that the instructions stored in the computer readablemedium produce an article of manufacture including instructions whichimplement the function/act specified in the flowchart and/or blockdiagram block or blocks.

The computer program instructions may also be loaded onto a computer,other programmable data processing apparatus, or other devices to causea series of operational steps to be performed on the computer, otherprogrammable apparatus or other devices to produce a computerimplemented process such that the instructions which execute on thecomputer or other programmable apparatus provide processes forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder, depending upon the functionality involved. It will also be notedthat each block of the block diagrams and/or flowchart illustration, andcombinations of blocks in the block diagrams and/or flowchartillustration, can be implemented by special purpose hardware-basedsystems that perform the specified functions or acts, or combinations ofspecial purpose hardware and computer instructions.

What is claimed is: 1-7. (canceled)
 8. An apparatus comprising: at leastone processor; and a storage device having instructions stored thereonthat, when executed by the at least one processor, cause the apparatusto: perform a scan, using a hardware mechanism, of a memory regionassociated with a virtual machine in response to a call, construct adata structure comprising information about substrings identified duringthe scan and a number of replications for each substring, and store thedata structure at a location determined by the call.
 9. The apparatus ofclaim 8, wherein the instructions, when executed by the at least oneprocessor, cause the apparatus to: determine at least one of a beginningaddress and a beginning register to start the scan from based on thecall, determine at least one of an ending address and an ending registerto end the scan based on the call, and perform the scan based on the atleast one of a beginning address and a beginning register and the atleast one of an ending address and an ending register.
 10. The apparatusof claim 8, wherein the call comprises a specification of a thresholdcorresponding to a minimum length for the substrings, and wherein theinstructions, when executed by the at least one processor, cause theapparatus to: identify the substrings during the scan based on adetermination that a length of each of the substrings is greater thanthe threshold.
 11. The apparatus of claim 8, wherein the data structureis stored at a memory address determined by the call.
 12. The apparatusof claim 8, wherein the memory region is referenced by a plurality ofvirtual machines, wherein the plurality of virtual machines includes thevirtual machine, and wherein the plurality of virtual machines arehosted by the apparatus.
 13. The apparatus of claim 8, wherein theinstructions, when executed by the at least one processor, cause theapparatus to: sort the information based on the number of replicationsfor each substring, wherein the data structure is stored based on thesorting.
 14. The apparatus of claim 8, wherein the memory region is acontiguous region of a memory.
 15. The apparatus of claim 8, wherein theinstructions, when executed by the at least one processor, cause theapparatus to: listen for the call as an assembler call.
 16. A computerprogram product comprising: a computer readable storage medium havingcomputer readable program code embodied therewith, the computer readableprogram code comprising: computer readable program code configured for:performing a scan of a memory region associated with a virtual machine,the performing by a hardware mechanism in response to a call,constructing a data structure comprising information about substringsidentified during the scan and a number of replications for eachsubstring, and storing the data structure at a location determined bythe call.
 17. The computer program product of claim 16, wherein thecomputer readable program code is further configured for: identifyingthe substrings during the scan based on determining that each of thesubstrings is of a length that is greater than a threshold specified bythe call.
 18. The computer program product of claim 16, wherein thememory region is referenced by a plurality of virtual machines, whereinthe plurality of virtual machines includes the virtual machine, andwherein the plurality of virtual machines are hosted by the machine. 19.The computer program product of claim 16, wherein the computer readableprogram code is further configured for: determining at least one of abeginning address and a beginning register to start the scan from basedon the call, determining at least one of an ending address and an endingregister to end the scan based on the call, and performing the scanbased on the at least one of a beginning address and a beginningregister and the at least one of an ending address and an endingregister.
 20. The computer program product of claim 16, wherein the scanis implemented using a hardware level language, and wherein the scan isperformed by a hypervisor of the machine.
 21. The computer programproduct of claim 16, wherein the data structure is a map of keys to alinked list, and wherein the computer readable program code is furtherconfigured for: locating a region for memory sharing by iterating over aplurality of contiguous fixed length memory regions and incrementing anindex into a page for each iteration until all indices within the pageand all region sizes within the page are computed, and storing anindication of the region for access by software in at least one of: thedata structure, and a register.